package com.example.sentinel.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/limiter")
public class RateLimiterController {
    @Autowired
    private RedisTemplate<String, String> redisTemplate;

    //初始化限流器
    @RequestMapping("/redisWrite")
    public void redisWrite() {
        redisTemplate.opsForValue().set("name", "zhangsan");
    }

}
